<?php

// +----------------------------------------------------------------------

namespace app\api\controller;

use app\common\controller\ApiUser;
use app\user\model\Member as MemberModel;
use util\Wxsdk;
use think\facade\Db;
/**
 * 用户Api控制器
 * @package app\api\controller
 */
class User extends ApiUser
{
	/**
	 * 获取用户信息
	 * @return array info 用户信息
	 */
	public function getInfo()
	{
		$user = MemberModel::find($this->userId);
		if ($user) {
			$return = $user->visible(['id','nickname','wxapp_openid','avatar_img','sex'])->toArray();
			$this->success('获取成功', $return);
		} else {
			$this->error('用户信息不存在');
		}
	}
}
